package com.example.hbutliving.domain.result;

import com.example.hbutliving.domain.dto.UnreadInteractiveMessageDto;
import com.example.hbutliving.domain.helper.QiNiuAddress;
import java.text.SimpleDateFormat;
import lombok.Data;

@Data
public class UnreadInteractiveMessageResult {
  private int activityId;
  private int userId;
  private String username;
  private String avatar;
  private String type;
  private String createTime;

  public UnreadInteractiveMessageResult(UnreadInteractiveMessageDto unreadInteractiveMessageDto) {
    activityId=unreadInteractiveMessageDto.getActivityId();
    userId= unreadInteractiveMessageDto.getUserId();
    username=unreadInteractiveMessageDto.getUsername();
    avatar=new QiNiuAddress(unreadInteractiveMessageDto.getAvatar()).toString();
    type= unreadInteractiveMessageDto.getType();
    createTime=new SimpleDateFormat("yyyy-MM-dd HH:mm").format(unreadInteractiveMessageDto.getCreateTime());
  }
}
